package com.whz.iplocation.http;

import lombok.Data;
import org.apache.http.client.config.RequestConfig;

import java.util.concurrent.TimeUnit;

/**
 * @author whz
 */
@Data
public class HttpClientPoolConfig {
    /*
     * thread pool config
     */
    private long timeToLive = 5;
    private TimeUnit timeUnitToLive = TimeUnit.MINUTES;
    private int maxTotalConnections = 200;
    private int MaxConnectionsPerRoute = 20;
    /*
     * request config
     */

    private RequestConfig defaultRequestConfig = RequestConfig.custom()
            .setSocketTimeout(10000)
            .setConnectTimeout(10000)
            .setCircularRedirectsAllowed(false)
            .setConnectionRequestTimeout(10000)
            .setContentCompressionEnabled(true)
            .build();

}